package cn.dw.mm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.dw.mm.domain.InspectionMission;
import cn.dw.mm.service.InspectionMissionService;

@Controller
@RequestMapping(value="/inspectionMission")
public class InspectionMissionController {
	
	@Autowired
	private InspectionMissionService inspectionMissionService;
	
	@RequestMapping(value="/insertMission" , method=RequestMethod.POST)
	@ResponseBody
	public int insertMission(InspectionMission inspectionMission) {
		System.out.println(inspectionMission.getMissionName() + inspectionMission.getTaskDate());
		inspectionMissionService.insertMission(inspectionMission);
		return inspectionMission.getId();
	}
	
	@RequestMapping(value="/selectByCondition" , method=RequestMethod.POST)
	@ResponseBody
	public List<InspectionMission> selectByCondition(InspectionMission inspectionMission) {
		return inspectionMissionService.selectByCondition(inspectionMission);
	}
}
